<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>申请提现</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="/zhenze/Public/home/css/reset.css"/>
		<link rel="stylesheet" href="/zhenze/Public/home/css/tixianshenqing.css" />
		<link rel="stylesheet" href="/zhenze/Public/home/css/font-awesome.min.css" />
	</head>
	<body>
		<div class="top">
			<a href='<?php echo U('agent/dailishouye');?>'><i class="fa fa-angle-left"></i></a>
			<p>申请提现</p>
		</div>
		<div class="cont">
			<div>
				<p><?php echo ($admininfo["money"]); ?><span>元</span></p>
				<p>当前余额</p>
			</div>
			<div>
				<p><?php echo ($admininfo["money"]); ?>元</p>
				<p>可提现金额</p>
			</div>
			<div class="clear"></div>
		</div>
		<ul>
		<form id="form1" name="form1" method="post" action="<?php echo U(agent/tixianshenqing,array('admin_id'=>$admininfo['admin_id']));?>">
			<li><p>真实姓名：</p><input type="text" name="info[uname]" id="uname" maxlength="10" /></li>
			<li><p>银行名称：</p><input type="text" name="info[bankname]" id="bankname" maxlength="15"/></li>
			<li><p>银行卡号：</p><input type="text" name="info[uidcard]" id="uidcard" maxlength="25"/></li>
			<li><p>提现金额：</p><input type="text" name="info[umoney]" id="umoney" maxlength="10"/></li>
		</form>
		</ul>
		<a href="<?php echo U('Agent/tixianjilu');?>"><p class="p1">提现记录</p></a>
		<p class="p2">
			提现规则<br />
			1.请按规定填写申请<br />
			2.管理员会及时和您联系确认信息<br />
			3.信息真实，3-5个工作日到账
		</p>
		<button onclick="tixian(<?php echo ($admininfo["money"]); ?>)">提现</button>

		<script src="/zhenze/Public/home/js/screenSize.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			function tixian(countmoney){
			    if(document.getElementById("uname").value==""){
			        alert('真实名不能为空!');
			        document.getElementById("uname").focus();
			        return false;
			    }

			    if(document.getElementById("bankname").value==""){
			        alert('银行名称不能为空!');
			        document.getElementById("bankname").focus();
			        return false;
			    }

			    if(document.getElementById("uidcard").value==""){
			        alert('银行卡不能为空!');
			        document.getElementById("uidcard").focus();
			        return false;
			    }

			    var mbname=document.getElementById("uidcard").value;
			    var reg = /^[0-9]+.?[0-9]*$/;
			    if(!reg.test(mbname)){
			      alert("银行卡号只能为数字！");
			      document.getElementById("uidcard").focus();
			      return false;
			    }	

			     if(document.getElementById("umoney").value==""){
			        alert('提现输入不能为空!');
			        document.getElementById("umoney").focus();
			        return false;
			    }

			    var money=document.getElementById("umoney").value;
			    if(!reg.test(money)){
			      alert("提现输入只能为数字！");
			      document.getElementById("umoney").focus();
			      return false;
			    }

			  if(money>countmoney){
			  	alert('提现金额不能大于总金额');
			  	document.getElementById("umoney").focus();
			  	return false;
			  }

			  document.getElementById("form1").submit();
		}
		</script>
	</body>
</html>